-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #3844 : handle gid/uid in user management #166
Fixes #3844 : handle gid/uid in user management #166
Conversation
…e (7) tested successfully
"/usr/sbin/useradd" | ||
args => "-m ${nameopt[${usergroup_user_index}]} -s ${usergroup_user_shell[${usergroup_user_index}]} ${usergroup_user_login[${usergroup_user_index}]}", | ||
classes => cf2_if_else("usermanagement_login_add_${usergroup_user_index}_repaired", "usermanagement_login_add_${usergroup_user_index}_error"), | ||
comment => "Create the user", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As explained in https://www.rudder-project.org/foswiki/Development/TechniqueBestPractices:
Attribute's arrows '=>' should all be at the same level, one character after the largest attribute name
in my opinion, this Technique should stop using useradd which is a binary but only our Product Owner could say about that. |
"any" usebundle => force_create_user_homedir("${usergroup_user_home[${usergroup_user_index}]}", "${usergroup_user_uid[${usergroup_user_index}]}", "${usergroup_user_gid[${usergroup_user_index}]}"), | ||
ifvarclass => "usermanagement_user_forcelocal_${usergroup_user_index}.usermanagement_user_pershome_${usergroup_user_index}"; | ||
|
||
"any" usebundle => force_create_user_homedir("/home/${usergroup_user_login[${usergroup_user_index}]}", "${usergroup_user_uid[${usergroup_user_index}]}", "${usergroup_user_gid[${usergroup_user_index}]}"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, the home will be created with the GID defined in the Webapp even if this box *Set user default group ID ?: * is unticked.
This is a good Pull Request from our Community. The new features seems great to me but we really need a functionnal review from our Product Owner. |
# UID handling | ||
## Is OK (Success) | ||
"@@userGroupManagement@@result_success@@${usergroup_directive_id[${usergroup_user_index}]}@@User ID@@${usergroup_user_login[${usergroup_user_index}]}@@${g.execRun}##${g.uuid}@#The user ${usergroup_user_login[${usergroup_user_index}]} ( ${repname[${usergroup_user_index}]} ) UID is OK" | ||
ifvarclass => "usermanagement_user_uid_${usergroup_user_index}_kept"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should prevent from having several reports containing Error + Repaired + Kept by the use of:
ifvarclass => "usermanagement_user_uid_${usergroup_user_index}_kept.!(usermanagement_user_uid_${usergroup_user_index}_error|usermanagement_user_uid_${usergroup_user_index}_repaired)";
At use, it seems to work but I don't know if adduser should continue to be used. |
…x_policy_xml_to_metadata_conversion_failure Fixes #4088: Fix policy.xml to metada.xml conversion failure in case of ...
Closing this PR, as the code changed too much. Will be superceded |
http://www.rudder-project.org/redmine/issues/3844